1. Field of the Invention
The present invention relates to a data transfer system for transferring data by transmitting data bi-directionally between a master device and a slave device connected with each other by a bus line such as an I2C bus.
2. Description of the Related Art
Such a data transfer system using an I2C (Inter-Integrated Circuit) bus connected between a master device and a slave device is described in Japanese Laid-Open Patent Application No. 9-265436. Such a data transfer system comprises a master device, such as a microcomputer, and a plurality of slave devices, such as a nonvolatile memory, IC, etc., that are connected with each other by two bus lines, namely a SDA line (a data transmission line) and a SCL line (a clock transmission line).
As shown in FIG. 3, a data transfer starts when a start condition S, i.e. a start condition of data transfer, is transmitted from a master device to a designated one of slave devices. The master device generates clock signals and transfers data. When a stop condition P, i.e. a stop condition of data transfer, is transmitted from the master device, data communication is stopped. Transferred data are formatted as shown in FIG. 3 (c).
In case a power failure or a momentary power failure occurs when data communication is made between the master device and the slave device, the operation of the master device and the slave device is stopped due to an interruption of power supply, and the communication is suspended just as it is. The master device also ceases to communicate in an abnormal state such as influences of disturbances, malfunctions and the like.
When a power failure or a momentary power failure is recovered and a power supply is reestablished, or an abnormal termination is reset to start, the master device becomes operable. In this case, the master device transmits a start condition to the slave device without taking into account the conditions of the slave device and the communication is commenced therebetween. When the communication cannot be commenced, some trials are repeated.
The master device commands a termination of operation immediately in response to a power failure or a momentary power failure to shutdown the operation as a power failure-processing task. The slave devices, however, do not perform such a power failure-processing task. Furthermore, there exists such a slave device that can operate with a lower power supply voltage and a slave device stops to operate under quite a lower power supply voltage as compared with the master device.
Accordingly, even when the master device ceases to operate due to an interruption of a power supply, a slave device still continues to operate until a power supply voltage decreases to some degree. In case a momentary power failure is recovered during this period, the master device starts to operate and commences communication. As the operation of a slave device is not suspended, the slave device determines that communication is still continued, and the slave device does not operate to terminate communication. Consequently, it is likely that the slave device makes an erroneous judgment on data that is transferred by the resumed communication. Thus, there occurs such problems that data stored in the slave device are rewritten by mistake, or that the slave device operates on the basis of mistaken data and finally runs out of control.
Furthermore, it is likely that the resumed communication becomes unstable due to noises caused by an interruption or recovery of a power supply and the slave device erroneously recognizes the noises as data, and consequently the slave device operates erroneously.
A stable operation can be ensured, even in a power interruption, by adding a back-up circuit for stabilizing a power supply source. However, such a measure requires a circuit design that is suitable for a system and increases the number of parts, which results in an increase of manufacturing costs.